package util;

import javax.swing.*;

/**
 * 提示框帮助类
 *
 * @author wyl
 */
public final class DialogHelper {


    public static void showSuccessDialog(String successMessage) {
        JOptionPane.showMessageDialog(null, successMessage, "成功", JOptionPane.INFORMATION_MESSAGE);
    }

    public static void showFailDialog(String failMessage) {
        JOptionPane.showMessageDialog(null, failMessage, "失败", JOptionPane.ERROR_MESSAGE);
    }

    public static void showWaringDialog(String waringMessage) {
        JOptionPane.showMessageDialog(null, waringMessage, "警告", JOptionPane.WARNING_MESSAGE);
    }


    public static boolean showConfirmDialog(String title, String message) {
        int res = JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION);
        return res == JOptionPane.YES_OPTION;
    }

}
